<template>
	<view class="uni_box home">
		<navbar title='平台公告' :yin="true">
		</navbar>
		<view class="content">
			<view class="list">
				<view class="item" v-for="(item,index) in list" :key="index" @click="getDetail(item)">
					<text class="AnnouncementTitle">{{item.title}}</text>
					<text class="AnnouncementTime" v-if="item.created_at">{{item.created_at}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			this.noticelist();
		},
		onShow() {
		},
		methods: {
			async noticelist(){
				let res = await this.$u.api.getNotice({
				});
				// console.log(res)
				this.list = res
			},
			getDetail(item){
				this.navrouter("/pages/TPage/NoticeDetail?id="+item.id);
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fff;
	}
	.content{
		background-color: #fff;
		.list{
			.item{
				border-bottom: 2rpx solid #F7F7F7;;
				padding: 22rpx 50rpx;
				display: flex;
				flex-direction: column;
				.AnnouncementTitle{
					font-family: Source Han Sans CN;
					font-weight: 400;
					font-size: 26rpx;
					color: #000000;
				}
				.AnnouncementTime{
					display: block;
					margin-top: 15rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					font-size: 22rpx;
					color: #666666;
				}
			}
		}
		// padding-bottom: 150rpx;
	}
</style>
